package com.enation.app.javashop.core.client.fallback.goods;

import com.enation.app.javashop.core.client.feignimpl.goods.TagClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 *  商品标签异常处理 fallback factory
 * @author kingapex
 * @version 1.0
 * @data 2022/5/28 14:18
 **/
@Component
public class TagClientFallbackFactory  extends BaseFallbackFactory<TagClientFeignImpl> {
    @Override
    protected TagClientFeignImpl fallback() {
        return new TagClientFallback();
    }

    /**
     * 商品标签异常处理
     *
     * @author zh
     * @version v7.0
     * @date 19/3/21 下午3:34
     * @since v7.0
     */
    @Component
    public static class TagClientFallback implements TagClientFeignImpl {

        private final Logger logger = LoggerFactory.getLogger(getClass());

        @Override
        public void addShopTags(Long sellerId) {
            logger.error("添加商家id为" + sellerId + "的商品标签失败");
        }
    }
}
